using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.InputSystem;
using UnityEngine;
public class PlayerInput : MonoBehaviour
{
    PlayerInputSystem inputActions;
    Vector2 axes=>inputActions.GamePlay.Move.ReadValue<Vector2>();
    public float axesX=> axes.x;
    public bool isInputMove=>axesX != 0f;
    public float axesY=> axes.y;
    public bool isInputOnMove=>axesY != 0f;
    /***********1.跳跃***********/
    public bool isInputJump=>inputActions.GamePlay.Jump.WasPressedThisFrame();
    public bool isInputStopJump=>inputActions.GamePlay.Jump.WasReleasedThisFrame();
    /***********2.攻击***********/
    public bool isInputAttack=>inputActions.GamePlay.Attack.WasPressedThisFrame();
    /***********3.翻滚***********/
    public bool isInputRoll=>inputActions.GamePlay.Roll.WasPressedThisFrame();
    public bool isInputStopRoll=>inputActions.GamePlay.Roll.WasReleasedThisFrame();
    /***********4.下落***********/
    public bool isInputFall=>inputActions.GamePlay.Fall.WasPressedThisFrame();
    public bool isInputStopFall=>inputActions.GamePlay.Fall.WasReleasedThisFrame();
    
    
    
    //
    private void Awake()
    {
        inputActions = new PlayerInputSystem();
    }
    
    //
    private void OnEnable()
    {
        inputActions.Enable();
    }
    
    //
    private void OnDisable()
    {
        inputActions.Disable();
    }
}